<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .btn1 {
      color: red;
      cursor: pointer;
    }
  </style>
</head>
<body>
  <h1>不充钱你会变强吗？</h1>
  <input type="text" id="input" value="5" placeholder="请输入充值金额">
  <button class="btn1" onclick="charge()">充值</button>
  <script>
    let input = document.getElementById('input');
    console.log(input.value);


    function charge() {
      alert('充值成功！充值金额：'+input.value+'元。')
    }
  </script>
</body>
</html>